package com.peaker.advertisingpro.utils

import com.peaker.advertisingpro.bean.ResPlayNum
import com.peaker.advertisingpro.db.AppDatabase

/**
 *  @ 作者 CODE_LYF
 *  @ 时间   2021/5/30.
 *  代码人生
 */
object DBUtils {
    /**
     * 播放统计
     */
    fun   addPlayNum(id:String,type:String){
        var playCount = AppDatabase.instance.resPlayNumDao().getPlayCount(id)
        if(playCount!=null){
            AppDatabase.instance.resPlayNumDao().addPlayCount(id)
        }else{
            AppDatabase.instance.resPlayNumDao().insert(ResPlayNum(id,type,1))
        }
    }
}